package com.rjwh.dingdong.client.mvp.model.impl;

import com.aishua.lib.task.AsResult;
import com.rjwh.dingdong.client.constant.NetConstant;
import com.rjwh.dingdong.client.mvp.BaseModel;
import com.rjwh.dingdong.client.mvp.BasePresenter;
import com.rjwh.dingdong.client.mvp.model.IMathGameRecordInfoModel;
import com.rjwh.dingdong.client.network.HttpWebService;
import com.rjwh.dingdong.client.network.HttpWebServiceCallBack;

import java.util.HashMap;
import java.util.Map;

/**
 * @author Kay
 * @ClassName MathGameRecordInfoModel
 * @Description
 * @date 2016-7-27
 * @history 2016-7-27 author: description:
 */
public class MathGameRecordInfoModel extends BaseModel implements IMathGameRecordInfoModel, HttpWebServiceCallBack {


    public MathGameRecordInfoModel(BasePresenter basePresenter) {
        super(basePresenter);
    }

    /**
     * 获取游戏记录
     *
     * @param bookid 游戏id
     */
    @Override
    public void doGetMathGameRecord(String bookid) {
        Map<String, String> params = new HashMap<>();
        params.put("bookid", bookid);
        HttpWebService.getDataFromServer(NetConstant.GETMATHGAMERECORD, params, true, this);
    }

    @Override
    public void onServerDataAcquired(int businessType, AsResult mAsResult, boolean isRefresh) {
        if(getBasePresenter()!= null) getBasePresenter().onServerDataAcquired(businessType, mAsResult, isRefresh);
    }
}
